import java.util.List;
public class Test {
    public static void main(String[] args) {
        Manager manager = new Manager();

        // 添加测试学生
        Students testStudent = new Students("003", "王五", 0, "计科 2302", "A103", false);
        manager.addStudent(testStudent);

        // 查找学生
        Students foundStudent = manager.findStudentById("003");
        if (foundStudent != null) {
            System.out.println("找到学生：");
            List<Students> singleStudentList = List.of(foundStudent);
            manager.showDatabaseView(singleStudentList);
        } else {
            System.out.println("未找到该学生");
        }

        // 更新学生信息
        Students updatedStudent = new Students("003", "赵六", 0, "计科 2302", "A104", true);
        boolean isUpdated = manager.updateStudent("003", updatedStudent);
        if (isUpdated) {
            System.out.println("学生信息更新成功");
            foundStudent = manager.findStudentById("003");
            if (foundStudent != null) {
                List<Students> updatedStudentList = List.of(foundStudent);
                manager.showDatabaseView(updatedStudentList);
            }
        } else {
            System.out.println("学生信息更新失败");
        }

        // 删除学生
        boolean isDeleted = manager.deleteStudent("003");
        if (isDeleted) {
            System.out.println("学生删除成功");
        } else {
            System.out.println("学生删除失败");
        }

        // 关闭连接
        manager.close();
    }
}